﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.Animations;
using UnityEngine.Playables;

namespace ActionSystem.Core.AnimationLogic
{
    public class PlayableAPIAnimationAbility : BaseAnimationAbility,IStateMachineChange
    {
        PlayableGraph graph;
        public PlayableAPIAnimationAbility(BaseStateMachine baseStateMachine, PlayableGraph graph) : base(baseStateMachine)
        {
            this.graph = graph;
            baseStateMachine.AddStateChanegCallback(this);
        }

        public override void AnimationEvaluate()
        {
            graph.Evaluate(StateMachine.LogicDeltaTime);
        }

        public void OnDestroy()
        {
            
        }

        public void OnStateChange(BaseState currenState, BaseState nextState, StateBlendData blendData)
        {
            throw new Exception("没有实现");
        }
    }
}
